<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="@{/}">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <!--font-family-->
    <link href="https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900&amp;subset=devanagari,latin-ext" rel="stylesheet">

    <!-- title of site -->
    <title>后台管理</title>

    <!--font-awesome.min.css-->
    <link rel="stylesheet" th:href="@{static/assets/css/font-awesome.min.css}">

    <!--animate.css-->
    <link rel="stylesheet" th:href="@{static/assets/css/animate.css}">

    <!--bootstrap.min.css-->
    <link rel="stylesheet" th:href="@{static/assets/css/bootstrap.min.css}">

    <!-- bootsnav -->
    <link rel="stylesheet" th:href="@{static/assets/css/bootsnav.css}" >

    <!--style.css-->
    <link rel="stylesheet" th:href="@{static/assets/css/style.css}">

    <!--responsive.css-->
    <link rel="stylesheet" th:href="@{static/assets/css/responsive.css}">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
<!--[if lte IE 9]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
<![endif]-->

<!-- signin end -->
<section class="signin">
    <div class="container-fluid">
        <div class="row">

            <div class="col-sm-4">
                <div class="single-sign">
                    <div class="sign-bg">

                    </div><!--/.sign-bg -->
                </div><!--/.single-sign -->
            </div><!--/.col -->

            <div class="col-sm-8">
                <div class="single-sign">
                    <div class="sign-content">
                        <h2>旅游拼团后台管理系统</h2>
                        <div class="signin-form">
                            <div class=" ">
                                <div class=" ">
                                    <form action="signin.html">
                                        <div class="form-group">
                                            <label for="username">用户名</label>
                                            <input type="email" class="form-control" id="username" placeholder="请输入用户名">
                                        </div><!--/.form-group -->
                                        <div class="form-group">
                                            <label for="password">密码</label>
                                            <input type="password" class="form-control" id="password" placeholder="请输入密码">
                                        </div><!--/.form-group -->
                                    </form><!--/form -->
                                </div><!--/.col -->
                            </div><!--/.row -->

                        </div><!--/.signin-form -->
                        <div class="signin-password">
                            <div class="awesome-checkbox-list">
                                <ul class="unstyled centered">

                                    <li>
                                        <input class="styled-checkbox" id="styled-checkbox-2" type="checkbox" value="value2">
                                        <label for="styled-checkbox-2">Keep me Signed in</label>
                                    </li>

                                </ul>
                            </div><!--/.awesome-checkbox-list -->
                        </div><!--/.signin-password -->

                        <div class="signin-footer">
                            <button type="button" class="btn signin_btn" id="loginButton">
                                登录
                            </button>
                            <p>
                                欢迎登录旅游拼团管理系统
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- signin end -->

<!--footer copyright start -->
<footer class="footer-copyright">
    <div id="scroll-Top">
        <i class="fa fa-angle-double-up return-to-top" id="scroll-top1" data-toggle="tooltip" data-placement="top" title="" data-original-title="Back to Top" aria-hidden="true"></i>
    </div>
</footer>
<script th:src="@{static/assets/js/jquery.js}"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/modernizr/2.8.2/modernizr.min.js"></script>
<script th:src="@{static/assets/js/bootstrap.min.js}"></script>
<script th:src="@{static/assets/js/bootsnav.js}"></script>
<script th:src="@{static/assets/js/jquery.sticky.js}"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js"></script>
<script th:src="@{static/assets/js/custom.js}"></script>
</body>
<script type="text/javascript">
    $("#loginButton").click(function(){
        var username = $('#username').val();
        var password = $('#password').val();
        if (username=='' || password==''){
            commonUtil.message("用户名或密码不能为空","danger");
        } else {
            login(username, password)
        }
    });
    //登陆的请求方法
    function login(username, password) {
        $.ajax({
            type: "POST",//方法类型
            url: "/login/login" ,//url
            data: {"username":username, "password":password},
            success: function (result) {
                if (result.code==200){
                    commonUtil.message("登录成功");
                    //登陆成功以后跳转到 /index 界面
                    window.location.href="/index"
                } else {
                    commonUtil.message(result.msg,"danger");
                }
            },
            error : function(error) {
                commonUtil.message("网络错误","danger");
            }
        });
    }
</script>

</html>